package com.huifaapp.mall.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.huifaapp.mall.R;
import com.huifaapp.mall.bean.TeamBean;

import java.util.List;

/**
 * Created by duanyu on 2018/1/5.
 */

public class tmall_teamtwoFragmentAdapter extends RecyclerView.Adapter<tmall_teamtwoFragmentAdapter.MyViewHolder> {
    private List<TeamBean.DataBean.ListBean>  stringList;
    private Context Context;

    public tmall_teamtwoFragmentAdapter(List<TeamBean.DataBean.ListBean> stringList, android.content.Context context) {
        this.stringList = stringList;
        Context = context;
    }

    @Override
    public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View recyclerViewItem = LayoutInflater.from(parent.getContext()).inflate(R.layout.itme_tmall_teamtwe, parent, false);
        return new MyViewHolder(recyclerViewItem);
    }

    @Override
    public void onBindViewHolder(MyViewHolder holder, int position) {
          holder.itme_tmallteamtwoName.setText(stringList.get(position).getUserName());
          holder.itme_tmallteamtwouserPhone.setText(stringList.get(position).getUserPhone());
          holder.itme_tmallteamtwo_inviteName.setText(stringList.get(position).getInviteName());
          holder.itme_tmallteamtwo_creatTime.setText(stringList.get(position).getTotalSale()+" ");
    }


    @Override
    public int getItemCount() {
        return stringList.size();
    }
    class MyViewHolder extends RecyclerView.ViewHolder {

        private final TextView itme_tmallteamtwoName;
        private final TextView itme_tmallteamtwouserPhone;
        private final TextView itme_tmallteamtwo_inviteName;
        private final TextView itme_tmallteamtwo_creatTime;

        public MyViewHolder(View itemView) {
            super(itemView);
            itme_tmallteamtwoName = (TextView) itemView.findViewById(R.id.itme_tmallteamtwoName);
            itme_tmallteamtwouserPhone = (TextView) itemView.findViewById(R.id.itme_tmallteamtwouserPhone);
            itme_tmallteamtwo_inviteName = (TextView) itemView.findViewById(R.id.itme_tmallteamtwo_inviteName);
            itme_tmallteamtwo_creatTime = (TextView) itemView.findViewById(R.id.itme_tmallteamtwo_creatTime);
        }
    }
}
